package com.ajun.springbootcondition.config;

import com.ajun.springbootcondition.condition.ConditionOnClass;
import com.ajun.springbootcondition.domain.User;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author AJun
 * @createDate 2025/3/12 下午7:40
 * @description:
 */

@Configuration
public class UserConfig {

    @Bean
//    @Conditional(ClassCondition.class)
//    @ConditionOnClass("redis.clients.jedis.Jedis")
//    @ConditionOnClass("com.alibaba.fastjson.JSON")
    public User user(){
        return new User();
    }

    @Bean
    @ConditionalOnProperty(name = "AJun", havingValue = "Lei")
    public User user2(){
        return new User();
    }

}
